package router

import (
"server/application/constant/apis"
"server/application/constant/enums"
"server/application/controller/custctrl"
"server/application/db/schema/sdto"
"server/application/dto"
"server/pkg/ginp"
)

func init() {

//创建
AppendRouter(ItemInfo{
Path:           apis.ApiTripItemCreate,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemCreate), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem.create",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "创建用户",
Description: "",
RequestDto:  sdto.TripItemCreate{},
},
})

//修改
AppendRouter(ItemInfo{
Path:           apis.ApiTripItemUpdate,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemUpdate), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem.update",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "修改用户",
Description: "",
RequestDto:  sdto.TripItemUpdate{},
},
})

// 删除
AppendRouter(ItemInfo{
Path:           apis.ApiTripItemDelete,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemDelete), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem.delete",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "删除用户",
Description: "",
RequestDto:  sdto.TripItemDelete{},
},
})

//search 搜索
AppendRouter(ItemInfo{
Path:           apis.ApiTripItemSearch,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemSearch), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem.search",                    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "获取用户列表",
Description: "",
RequestDto:  dto.ReqSearch{},
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiTripItemImport,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemImport), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem." + enums.BtnAuthImport,    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "导入用户",
Description: "",
RequestDto:  dto.ReqSearch{},
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiTripItemImportTemplateFile,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemImportTemplateFile), //对应控制器
HttpType:       HttpPost,                                          //http请求类型
NeedLogin:      true,                                              //是否需要登录
NeedPermission: false,                                             //是否需要鉴权
PermissionName: "TripItem." + enums.BtnAuthImport,                //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "获取导入用户模板文件",
Description: "",
},
})

AppendRouter(ItemInfo{
Path:           apis.ApiTripItemExport,               //api路径
Handlers:       ginp.ConvHandler(custctrl.TripItemExport), //对应控制器
HttpType:       HttpPost,                              //http请求类型
NeedLogin:      true,                                  //是否需要登录
NeedPermission: true,                                  //是否需要鉴权
PermissionName: "TripItem." + enums.BtnAuthExport,    //完整的权限名称,会跟权限表匹配
Swagger: &SwaggerInfo{
Title:       "导出用户",
Description: "",
},
})

//{{append}}

}
